package com.wj.dubbo.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.wj.console.rabbit.message.CrawlerSocialFundMessage;
import com.wj.dubbo.service.config.RabbitMQConfig;
//@EnableScheduling
@Component
public class RabbitMessageSender {
	private static final Logger log = LoggerFactory.getLogger(RabbitMessageSender.class);
	@Autowired
	private RabbitTemplate rabbitTemplate;

	@Scheduled(fixedDelay = 1000L)
	public void sendMessage() {
		CrawlerSocialFundMessage message = new CrawlerSocialFundMessage();
		message.setIdentityId("idno");
		message.setJointCard("ddsfsdf");
		message.setMemberId("dfsdfdf");
		message.setPwd("sdfsdfsdf");
		log.info("Sending CrawlerFundMessage...");
		rabbitTemplate.convertAndSend(RabbitMQConfig.EXCHANGE_NAME, RabbitMQConfig.QUEUE_CRAWLER_FUND_NAME, message);
		
//		CrawlerSocialFundMessage message1 = new CrawlerSocialFundMessage();
//		message1.setIdentityId("idno1");
//		message1.setMemberId("dfsdfdf1");
//		message1.setPwd("sdfsdfsdf1");
//		log.info("Sending CrawlerSocialMessage...");
//		rabbitTemplate.convertAndSend(RabbitMQConfig.EXCHANGE_NAME, RabbitMQConfig.QUEUE_CRAWLER_SOCIAL_NAME, message1);
	}
}
